![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@eximchain/dappbot-types
Advanced tools
Typescript bindings describing the core data types and API interactions with DappBot. Extracted into their own repository in order to :
There is full generated documentation from the source code hosted at eximchain.github.io/dappbot-types
. Briefly, the types are grouped into nested namespaces in order to minimize both collisions and stuttering. They are nested like:
DappBotTypes
: Overall namespace, package's default export
Dapp
: Interfaces, type guards, and factories related to the DappItem
data typeUser
: Interfaces, type guards, and factories related to the User
& auth data typesResponses
: Interfaces and helper functions for our API responsesMethods
: Each sub-module within here (Auth
, Payment
, Private
, Public
) contains all types related to that resource's available methods. Each method contains keys Args
, Result
, Response
, HTTP
, & Path
. The Result
corresponds to the res.data
in a successful call, Response
just wraps that shape in data
/err
.As a consumer, you can import either import the full namespace from the top or instead use the import string to grab one of the more nested ones. All of the individual namespaces & types are declared within the spec
folder, which you can directly refer to in your import. By example, below are two ways of getting at the same type:
// Grab the overall types object and drill down through
// the namespaces to get the interface we want
import Types from 'dappbot-types';
const argsFromType:Types.Methods.Auth.Login.Args = {
username : 'wuddup',
password : 'we here',
yis : 'this prop is not legal and gets an error'
}
// Now we're going through the file structure to more
// directly grab the namespace with the types we're
// concerned about in this hypothetical file.
import { Login } from 'dappbot-types/spec/methods/auth';
const argsFromAuth:Login.Args = {
username : "this object will have err because it's missing a property"
}
FAQs
Typescript bindings to interact with the DappBot API
We found that @eximchain/dappbot-types demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.